import java.io.File;
import java.util.Scanner;

/**
 * Created by cc
 * Description:
 * User: CZH
 * Date: 2022-09-26
 * Time: 16:53
 */
public class Test02 {
//    public static String readFile(){
//        File file = new File("d:/test.txt");
//
//    }

    public static void main3(String[] args) {
        System.out.println(func());
    }

    public static int func(){
        try {
            return 10;
        }finally {
            return 20;
        }
    }

    public static int divide(int x, int y) throws ArithmeticException{
        if (y == 0) {
            throw new ArithmeticException("抛出除数为0异常");
        }
        return x / y;
    }

    public static void main2(String[] args) {
        System.out.println(divide(10, 0));
    }

    public static void main1(String[] args) {
        try(Scanner sc = new Scanner(System.in)) {
            int num = sc.nextInt();
            System.out.println(num);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
